﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace DLLCOM
{
    /// <summary>
    /// RegEdit.xaml 的交互逻辑
    /// </summary>
    public partial class RegEdit : UserControl
    {
        DLL_Reg dll = new DLL_Reg();
        public RegEdit()
        {
            InitializeComponent();
            Address.Text = dll.ShowNow();
        }
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            dll.Enter(name.Text);
            Address.Text = dll.ShowNow();
            Out.Text = dll.ShowAll();
        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            dll.Back();
            Address.Text = dll.ShowNow();
            Out.Text = dll.ShowAll();
        }

        private void button3_Click(object sender, RoutedEventArgs e)
        {
            
            Out.Text = dll.GetValue();
        }

        private void button4_Click(object sender, RoutedEventArgs e)
        {
            dll.SetValue(name.Text, valName.Text, value.Text);
            Out.Text = dll.GetValue();
        }

        private void button5_Click(object sender, RoutedEventArgs e)
        {
            Out.Text = dll.ShowAll();
        }

        private void button6_Click(object sender, RoutedEventArgs e)
        {
            dll.DeleteKey(name.Text);
            Out.Text = dll.ShowAll();
        }

        private void button7_Click(object sender, RoutedEventArgs e)
        {
            dll.DeleteValue(valName.Text);
            Out.Text = dll.GetValue();
        }
    }
}
